﻿using BarManager.Core.Entity;
using System.Data.Entity.ModelConfiguration;

namespace BarManager.Infrastructure.Data.Mapping
{
    public class PoolMap : EntityTypeConfiguration<Pool>
    {
        public PoolMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Descripcion)
                .IsRequired()
                .HasMaxLength(150);

            // Table & Column Mappings
            this.ToTable("Pools");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Descripcion).HasColumnName("Descripcion");
            this.Property(t => t.PrecioHora).HasColumnName("PrecioHora");
            this.Property(t => t.Habilitada).HasColumnName("Habilitada");
            this.Property(t => t.FraccionMinutos).HasColumnName("FraccionMinutos");
        }
    }
}
